home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / foss11b3.zip / DEVELOP / TYPES.PAS < prev   
Pascal/Delphi Source File  |  1996-06-19  |  39KB  |  810 lines

  1. unit Types;
  2.  
  3. interface
  4. const
  5. { ========================================================================== }
  6. { Size of maximum sized 16-bit arrays of Byte, Word or LongInts              }
  7. { ========================================================================== }
  8.   CByteMaxHigh     = 65520;
  9.   CWordMaxHigh     = ( CByteMaxHigh div 2 );
  10.   CLongMaxHigh     = ( CWordMaxHigh div 2 );
  11.  
  12. { ========================================================================== }
  13. { Maximum sized 16-bit arrays of Byte, Word or LongInts                      }
  14. { ========================================================================== }
  15. type
  16.   TByteMax         = array[0..( CByteMaxHigh - 1 )] of Byte;
  17.   TWordMax         = array[0..( CWordMaxHigh - 1 )] of Word;
  18.   TLongMax         = array[0..( CLongMaxHigh - 1 )] of LongInt;
  19.  
  20. { ========================================================================== }
  21. { Maximum sized 16-bit arrays which can be accessed as Byte, Word or
  22.   LongInts                                                                   }
  23. { ========================================================================== }
  24. type
  25.   TBufMax          = record
  26.     case Byte of
  27.       0: ( Bytes   : TByteMax );
  28.       1: ( Words   : TWordMax );
  29.       2: ( Longs   : TLongMax );
  30.   end; { record TBufMax }
  31.  
  32. { ========================================================================== }
  33. { Message text buffer, buffer used for all kind of messages in FOSS          }
  34. { ========================================================================== }
  35. type
  36.   PMsgBuffer       = ^TMsgBuffer;
  37.   TMsgBuffer       = array[0..( CByteMaxHigh - 1 )] of Char;
  38.  
  39. { ========================================================================== }
  40. { Types orginally defined in the DOS unit                                    }
  41. { ========================================================================== }
  42. type
  43.   PathStr          = string[79];
  44.   DirStr           = string[67];
  45.  
  46. { ========================================================================== }
  47. { String types, just to simplify further definitions                         }
  48. { ========================================================================== }
  49. type
  50.   Str4             = string[4];
  51.   Str6             = string[6];
  52.   Str10            = string[10];
  53.   Str12            = string[12];
  54.   Str16            = string[16];
  55.   Str30            = string[30];
  56.   Str40            = string[40];
  57.   Str46            = string[46];
  58.   Str60            = string[60];
  59.   Str80            = string[80];
  60.   Str200           = string[200];
  61.  
  62. { ========================================================================== }
  63. { Date and time types                                                        }
  64. { ========================================================================== }
  65. type
  66.   TDate            = record
  67.     case Word of
  68.       0: ( Year    : Word;
  69.            Month,
  70.            Day     : Byte );
  71.       1: ( RAW     : LongInt );
  72.   end; { record TDate (4 Bytes) }
  73.  
  74.   TTime            = record
  75.     case Byte of
  76.       0: ( Hour,
  77.            Minute  : Byte );
  78.       1: ( RAW     : Word );
  79.   end; { record TTime (2 Bytes) }
  80.  
  81.   TDateTime        = record
  82.     Date           : TDate;
  83.     Time           : TTime;
  84.   end; { record TDateTime (6 Bytes) }
  85.  
  86. { ========================================================================== }
  87. { Password type, used to store password and Expiry date                      }
  88. { ========================================================================== }
  89. type
  90.   TPassword        = record
  91.     Pwd            : Str12;            { Password string }
  92.     Date           : TDate;            { Expire date of password }
  93.   end; { record TPassword }
  94.  
  95. { ========================================================================== }
  96. { System text type, used to store the FOSSTEXT.* files in memory             }
  97. { ========================================================================== }
  98. type
  99.   TTxt             = record
  100.     Pnt            : array[0..799] of record
  101.       Pos          : Word;             { Position of text in Text array }
  102.       Len          : Char;             { Length of text in Text array }
  103.     end; { record Pnt }
  104.     Text           : array[0..49151] of Byte;
  105.   end; { record TTxt }
  106.  
  107. { ========================================================================== }
  108. { System meny types, used to store meny setup from FOSSTEXT.* files in
  109.   memory                                                                     }
  110. { ========================================================================== }
  111. type
  112.   TMenuKey         = record
  113.     Func           : string[25];       { Command string }
  114.     MinKey         : Byte;             { Minimum number of matched
  115.                                          characters from start of string }
  116.   end; { record TMenuKey }
  117.  
  118.   PMenus           = ^TMenus;
  119.   TMenus           = array[0..99] of TMenuKey;
  120.  
  121. { ========================================================================== }
  122. { Access type, used to store different sets of Access in areas               }
  123. { ========================================================================== }
  124. type
  125.   TAccess          = ( acReadMsg,      { Allowed to read messages }
  126.                        acWriteMsg,     { Allowed to write messages }
  127.                        acUploadFile,   { Allowed to upload files }
  128.                        acDownloadFile, { Allowed to download files }
  129.                        acOpenDoor,     { Allowed to open doors }
  130.                        acAreaOp,       { Allowed to use AreaOp functions in
  131.                                          SysOp menu }
  132.                        acSysOp,        { Allowed to use SysOp function in
  133.                                          SysOp menu }
  134.                        acRFU );        { RFU }
  135.   SAccess          = set of TAccess;
  136.  
  137. { ========================================================================== }
  138. { Graph type, used to store what kind of additional control characters to
  139.   send in addition to the standard AscII set                                 }
  140. { ========================================================================== }
  141. type
  142.   TGraph           = ( grIBM,          { Allow high 128+ AscII characters }
  143.                        grANSI );       { Allow ANSI control codes }
  144.   SGraph           = set of TGraph;
  145.  
  146. { ========================================================================== }
  147. { ClearScr type, used to store when the user wants the screen blanked        }
  148. { ========================================================================== }
  149. type
  150.   TClearScr        = ( clMenu,         { Clear screen before menus }
  151.                        clMsg,          { Clear screen before messages }
  152.                        clBullet );     { Cleer screen before bulletins }
  153.   SClearScr        = set of TClearScr;
  154.  
  155. { ========================================================================== }
  156. { ANSIUse type, used to store when the user wants ANSI graphics used         }
  157. { ========================================================================== }
  158. type
  159.   TANSIUse         = ( anMenu,         { Use ANSI graphics in menus }
  160.                        anMsg,          { Use ANSI graphics in messages }
  161.                        anBullet );     { Use ANSI graphics in bulletins }
  162.   SANSIUse         = set of TANSIUse;
  163.  
  164. { ========================================================================== }
  165. { ARC type, used to store preferred archive format                           }
  166. { ========================================================================== }
  167. type
  168.   TArc             = ( arNone,         { Archiving not preferred }
  169.                        arZIP,          { Use ZIP archiving }
  170.                        arARC,          { Use ARC archiving }
  171.                        arLZH,          { Use LZH/LHA archiving }
  172.                        arARJ );        { Use ARJ archiving }
  173.  
  174. { ========================================================================== }
  175. { AreaMark type, used to store message marking in memory                     }
  176. { ====